home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compute! Gazette 1990 April
/
1990-04.d64
/
dir example
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
1KB
|
61 lines
0 rem
10 ' copyright 1990 compute! publications, inc. - all rights reserved
20 'directory (bassem)
30 (NULL) $a000,$b000:(NULL)usr 1,0:(NULL)sqr 1
40 (NULL)usr 1,0:' no warnings for zeroes
50 (NULL)sqr 1:' write to memory
60 'write "dir.ml,p,w":'create ml file
70 (NULL)rnd $c000:' start address
80 (NULL) 1
90 '
100 (NULL)setlfs=65466
110 (NULL)setnam=65469
120 (NULL)open=65472
130 (NULL)chkin=65478
140 (NULL)chrin=65487
150 (NULL)chrout=65490
160 (NULL)close=65475
170 (NULL)clrchn=65484
180 (NULL)zp=251
190 (NULL)linprt=48589
200 '
210 (NULL)clr #1
220 (NULL)cmd #8:' device number
230 (NULL)sys #0
240 (NULL)list (NULL)setlfs
250 (NULL)clr #2:' length of filename
260 (NULL)cmd #<(NULL)filenm:' name is "$0" for directory
270 (NULL)sys #>(NULL)filenm
280 (NULL)list (NULL)setnam
290 (NULL)list (NULL)open
300 (NULL)cmd #1:' input from file 1
310 (NULL)list (NULL)chkin
320 (NULL)list (NULL)chrin:' discard track and sector bytes
330 (NULL)list (NULL)chrin
340 (NULL)newent (NULL)list (NULL)chrin
350 (NULL)/ (NULL)zp
360 (NULL)list (NULL)chrin
370 ora (NULL)zp:' check for two consecutive zeroes indicating last entry
380 (NULL)input# (NULL)exit
390 (NULL)clr #13:' print <cr> for each entry
400 (NULL)list (NULL)chrout
410 (NULL)pause (NULL)clr 653:' shift key pause
420 and #1
430 (NULL)read (NULL)pause
440 (NULL)list (NULL)chrin:' get low byte
450 (NULL)or
460 (NULL)list (NULL)chrin:' get high byte
470 (NULL)list (NULL)linprt:' print the number of blocks
480 (NULL)clr #32:' insert a space
490 (NULL)list (NULL)chrout
500 (NULL)loop (NULL)list (NULL)chrin
510 (NULL)input# (NULL)newent:' zero byte ends an entry
520 (NULL)list (NULL)chrout
530 (NULL)read (NULL)loop:' loop back for more
540 (NULL)exit (NULL)clr #1:' all done, close and reset channels
550 (NULL)list (NULL)close
560 (NULL)list (NULL)clrchn
570 (NULL)not
580 (NULL)filenm (NULL)abs "$0"
590 (NULL) 2